package com.jmars.TS.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 定时任务
 *
 * @author CL
 *
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "[wms].[t_sys_job_log]")
@EqualsAndHashCode(callSuper = false)
public class SysJobLog extends Model<SysJobLog> implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * ID
	 */
	@TableId(type = IdType.AUTO)
	private Integer jobLogId;

	/**
	 * 任务名称
	 */
	private String jobName;


	/**
	 * 任务分组
	 */
	private String jobGroup;


	/**
	 * cron表达式
	 */
	private String invokeTarget;

	/**
	 * 任务执行类（包名+类名）
	 */
	private String jobMessage;

	/**
	 * 任务状态（0-停止，1-运行）
	 */
	private String status;

	/**
	 * 参数
	 */
	private String exceptionInfo;

	private Date createTime;

	public SysJobLog(String jobName, String jobGroup, String invokeTarget, String jobMessage, String status, String exceptionInfo) {
		this.jobName = jobName;
		this.jobGroup = jobGroup;
		this.invokeTarget = invokeTarget;
		this.jobMessage = jobMessage;
		this.status = status;
		this.exceptionInfo = exceptionInfo;
		this.createTime = new Date();
	}
}
